package com.example.zhang.service;

import com.example.zhang.entity.TbUser;
import org.springframework.stereotype.Service;
import com.example.zhang.dao.TbUserDAO;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service

public class TbUserServicempl implements TbUserservice{
    @Autowired
    private TbUserDAO tbUserDAO;
    @Override
    public List<TbUser> findAll() {

        return tbUserDAO.findAll();
    }
    @Override
    public String add(TbUser user){
        int status = tbUserDAO.add(user);
        if(status>0)
        {
            return "插入成功";
        }
        else {
            return "插入失败";
        }
    }
}
